home *** CD-ROM | disk | FTP | other *** search
/ The X-Philes (2nd Revision) / The X-Philes Number 1 (1995).iso / xphiles / hp48hor1 / rpl.doc < prev    next >
Text File  |  1995-03-31  |  2KB  |  62 lines

  1. Random notes from HP BBS.  Author: Rick Grevelle 
  2.  
  3. Commands, Functions, SYSEVALs, etc. point to RPL objects, not machine code. 
  4. What you are really seeing is the prolog (02D9D) of a RPL program object. Every 
  5. RPL routine begins with these five nibbles.  A machine code object begins with 
  6. 02DCC and a five nibble length.  Note that all addresses appear in reverse 
  7. order in memory. 
  8.  
  9. Regarding START, DO, IF...  the difficult task is deciphering the numerous 
  10. machine routines used internally by RPL to handle these structures. The 
  11. relatively few prefixed machine routines used to support keywords such as these 
  12. are just the tip of the iceberg as far as the internal world of RPL is 
  13. concerned. 
  14.  
  15. Further, many of these are multifacited in that they will perform differently 
  16. depending on what conditions exist at the time of execution.  Take for example 
  17. the prefixed machine routine responsible for both keywords START and DO.  The 
  18. routine's address is #71A2h.  Here is an example of how this routine works. 
  19.  
  20.      Used as START 
  21.  
  22.      02D9D  begin RPL 
  23.      23754  list_{ 'noname 'stop } 
  24.             (these are local variables used to store the start and end of loop) 
  25.      074D0  store_local_variables 
  26.      071A2  start 
  27.      ..... 
  28.      .....  (loop clause) 
  29.  
  30.      2326A  next 
  31.      0312B  end RPL 
  32.  
  33.  
  34.      Used as DO 
  35.  
  36.      02D9D  begin RPL 
  37.      071A2  do 
  38.      ..... 
  39.      ..... 
  40.      
  41.      071C8  end? (requires boolean #3A81h, true; or #3AC0h, false) 
  42.  
  43. Here are some other clause addresses I've currently documented in the 48: 
  44.  
  45. 073C3  start 0 to n-1 1short 
  46. 073C3  start 1 to n-1 1short 
  47. 073DB  start 1 to n-1 1short 
  48. 073F7  start n2 to n1 1short2short 
  49. 07221  current loop increment 
  50. 07249  n of loop 
  51. 07334  next 
  52. 073A5  step 
  53.  
  54. If you're interested in how these routines manipulate data, do what I did and 
  55. disassemble them.  If it's the keyword structures such as DO UNTIL END, START 
  56. NEXT, or IF THEN ELSE in which you're interested, store them in the top of the 
  57. RAM and PEEK at what is there.  The manner in which these are stored is fairly 
  58. straight foward; there is some nesting which occurs, but it shouldn't be any 
  59. sort of a problem for you. 
  60.  
  61. Rick Grevelle 
  62.